﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ExtremeLearningMachine;

namespace HarmonnySearch
{
    public class HSParticle
    {
        public List<byte> Values;
        public double Fitness;
        public ELMConfiguration Config;
        public ELM ELM;
        public double[][] B;
        public double[][] W;
        public double EMQTrain;
        public double EMQValidation;

        public double EPMATrain;
        public double EPMAValidation;

        public double RMSETrain;
        public double RMSEValidation;
        
        public double DEVTrain;
        public double DEVValidation;
        
        public double SRTrain;
        public double SRValidation;


        
        public List<byte> GetSubListValuesFromIndex(int count)
        {
            return Values.GetRange(0, count);   
        }

        public int GetFlagCountFromSubListValues(int index)
        {
            return GetSubListValuesFromIndex(index).Count(v => v == 1);
        }

        public int GetHiddenNodes(int index, int count)
        {
            return Values.GetRange(index, count).Count(v => v == 1);
        }
    }
}
